import React, { useEffect, useState } from 'react'

export default function App() {
    const [name, setName] = useState("sam")
    useEffect(
        () => {
            setName(name.substring(0, 1).toUpperCase() + name.substring(1))
        },
        [name]
    )
    return (
        <div>
            App-{name} <br/>
            <input type="text" onChange={(evt) => {
                setName(evt.target.value);
            }}/>
        </div>
    )
}
